import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:何人亮
 * Date:2024-11-13
 * 23:09
 */
public class Test {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        long time=sc.nextLong();
        time=time/1000;//毫秒化为秒
        long h=time/3600%24;//秒化为小时
        long min=time%3600/60;//分钟
        long s=time%60;//秒
        System.out.printf("%02d:%02d:%02d",h,min,s);
    }
}
